﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Caliburn.Micro;

namespace Zero.Frontend
{
    //public class InitializationResult : IResult
    //{
    //    private IResult _sequential;

    //    public InitializationResult(IEnumerable<IResult> enumerator)
    //    {
    //        _sequential = new SequentialResult(enumerator.GetEnumerator());
    //    }

    //    public void Execute(ActionExecutionContext context)
    //    {
    //        _sequential.Completed += _sequential_Completed;

    //        _sequential.Execute(context);            
    //    }

    //    void _sequential_Completed(object sender, ResultCompletionEventArgs e)
    //    {
    //        _sequential.Completed -= _sequential_Completed;

    //        if (e.Error != null)
    //        {
    //            Error = e.Error;
    //        }

    //        Completed(this, new ResultCompletionEventArgs() {WasCancelled = e.WasCancelled});           
    //    }

    //    public event EventHandler<ResultCompletionEventArgs> Completed = delegate { };

    //    public Exception Error { get; private set; }

    //    public bool Successful { get { return Error == null; } }
    //}
}
